home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / MorphOS / cvs-1.11.2 / source / amiga / netinclude / clib / bsdsocket_protos.h
Encoding:
C/C++ Source or Header  |  2002-11-18  |  7.2 KB  |  183 lines

  1. #ifndef  CLIB_BSDSOCKET_PROTOS_H
  2. #define  CLIB_BSDSOCKET_PROTOS_H
  3.  
  4. /*
  5. **    $Id: bsdsocket_protos.h,v 1.10 2002/10/30 15:53:27 obarthel Exp $
  6. **
  7. **    C prototypes. For use with 32 bit integers only.
  8. **
  9. **    Copyright © 2001-2002 Olaf Barthel
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif /* __cplusplus */
  16.  
  17. #ifndef  EXEC_LISTS_H
  18. #include <exec/lists.h>
  19. #endif
  20. #ifndef  DEVICES_TIMER_H
  21. #include <devices/timer.h>
  22. #endif
  23. #ifndef  UTILITY_TAGITEM_H
  24. #include <utility/tagitem.h>
  25. #endif
  26. #ifndef  UTILITY_HOOKS_H
  27. #include <utility/hooks.h>
  28. #endif
  29. #ifndef  NETINET_IN_H
  30. #include <netinet/in.h>
  31. #endif
  32. #ifndef  SYS_TYPES_H
  33. #include <sys/types.h>
  34. #endif
  35. #ifndef  SYS_SOCKET_H
  36. #include <sys/socket.h>
  37. #endif
  38. #ifndef  SYS_MBUF_H
  39. #include <sys/mbuf.h>
  40. #endif
  41. #ifndef  NET_ROUTE_H
  42. #include <net/route.h>
  43. #endif
  44. #ifndef  NETDB_H
  45. #include <netdb.h>
  46. #endif
  47. #ifndef  LIBRARIES_BSDSOCKET_H
  48. #include <libraries/bsdsocket.h>
  49. #endif
  50. #ifndef  DOS_DOSEXTENS_H
  51. #include <dos/dosextens.h>
  52. #endif
  53.  
  54. LONG socket( LONG domain, LONG type, LONG protocol );
  55. LONG bind( LONG sock, struct sockaddr *name, LONG namelen );
  56. LONG listen( LONG sock, LONG backlog );
  57. LONG accept( LONG sock, struct sockaddr *addr, LONG *addrlen );
  58. LONG connect( LONG sock, struct sockaddr *name, LONG namelen );
  59. LONG sendto( LONG sock, APTR buf, LONG len, LONG flags, struct sockaddr *to, LONG tolen );
  60. LONG send( LONG sock, APTR buf, LONG len, LONG flags );
  61. LONG recvfrom( LONG sock, APTR buf, LONG len, LONG flags, struct sockaddr *addr, LONG *addrlen );
  62. LONG recv( LONG sock, APTR buf, LONG len, LONG flags );
  63. LONG shutdown( LONG sock, LONG how );
  64. LONG setsockopt( LONG sock, LONG level, LONG optname, APTR optval, LONG optlen );
  65. LONG getsockopt( LONG sock, LONG level, LONG optname, APTR optval, LONG *optlen );
  66. LONG getsockname( LONG sock, struct sockaddr *name, LONG *namelen );
  67. LONG getpeername( LONG sock, struct sockaddr *name, LONG *namelen );
  68. LONG IoctlSocket( LONG sock, ULONG req, APTR argp );
  69. LONG CloseSocket( LONG sock );
  70. LONG WaitSelect( LONG nfds, APTR read_fds, APTR write_fds, APTR except_fds, struct timeval *timeout, ULONG *signals );
  71. VOID SetSocketSignals( ULONG int_mask, ULONG io_mask, ULONG urgent_mask );
  72. //LONG getdtablesize( VOID );
  73. LONG ObtainSocket( LONG id, LONG domain, LONG type, LONG protocol );
  74. LONG ReleaseSocket( LONG sock, LONG id );
  75. LONG ReleaseCopyOfSocket( LONG sock, LONG id );
  76. LONG Errno( VOID );
  77. VOID SetErrnoPtr( APTR errno_ptr, LONG size );
  78. STRPTR Inet_NtoA( ULONG ip );
  79. ULONG inet_addr( STRPTR cp );
  80. ULONG Inet_LnaOf( ULONG in );
  81. ULONG Inet_NetOf( ULONG in );
  82. ULONG Inet_MakeAddr( ULONG net, ULONG host );
  83. ULONG inet_network( STRPTR cp );
  84. struct hostent *gethostbyname( STRPTR name );
  85. struct hostent *gethostbyaddr( STRPTR addr, LONG len, LONG type );
  86. struct netent *getnetbyname( STRPTR name );
  87. struct netent *getnetbyaddr( ULONG net, LONG type );
  88. struct servent *getservbyname( STRPTR name, STRPTR proto );
  89. struct servent *getservbyport( LONG port, STRPTR proto );
  90. struct protoent *getprotobyname( STRPTR name );
  91. struct protoent *getprotobynumber( LONG proto );
  92. VOID vsyslog( LONG pri, STRPTR msg, APTR args );
  93. VOID syslog( LONG pri, STRPTR msg, ... );
  94. LONG Dup2Socket( LONG old_socket, LONG new_socket );
  95. LONG sendmsg( LONG sock, struct msghdr *msg, LONG flags );
  96. LONG recvmsg( LONG sock, struct msghdr *msg, LONG flags );
  97. //LONG gethostname( STRPTR name, LONG namelen );
  98. //ULONG gethostid( VOID );
  99. LONG SocketBaseTagList( struct TagItem *tags );
  100. LONG SocketBaseTags( Tag tag1, ... );
  101. LONG GetSocketEvents( ULONG *event_ptr );
  102. /* Ten reserved slots for future expansion */
  103. /* Berkeley Packet Filter (Roadshow extensions start here) */
  104. LONG bpf_open( LONG channel );
  105. LONG bpf_close( LONG channel );
  106. LONG bpf_read( LONG channel, APTR buffer, LONG len );
  107. LONG bpf_write( LONG channel, APTR buffer, LONG len );
  108. LONG bpf_set_notify_mask( LONG channel, ULONG signal_mask );
  109. LONG bpf_set_interrupt_mask( LONG channel, ULONG signal_mask );
  110. LONG bpf_ioctl( LONG channel, ULONG command, APTR buffer );
  111. LONG bpf_data_waiting( LONG channel );
  112. /* Route management */
  113. LONG AddRouteTagList( struct TagItem *tags );
  114. LONG AddRouteTags( Tag tag1, ... );
  115. LONG DeleteRouteTagList( struct TagItem *tags );
  116. LONG DeleteRouteTags( Tag tag1, ... );
  117. VOID FreeRouteInfo( struct rt_msghdr *buf );
  118. struct rt_msghdr *GetRouteInfo( LONG address_family, LONG flags );
  119. /* Interface management */
  120. LONG AddInterfaceTagList( STRPTR interface_name, STRPTR device_name, LONG unit, struct TagItem *tags );
  121. LONG AddInterfaceTags( STRPTR interface_name, STRPTR device_name, LONG unit, ... );
  122. LONG ConfigureInterfaceTagList( STRPTR interface_name, struct TagItem *tags );
  123. LONG ConfigureInterfaceTags( STRPTR interface_name, ... );
  124. VOID ReleaseInterfaceList( struct List *list );
  125. struct List *ObtainInterfaceList( VOID );
  126. LONG QueryInterfaceTagList( STRPTR interface_name, struct TagItem *tags );
  127. LONG QueryInterfaceTags( STRPTR interface_name, ... );
  128. LONG CreateAddrAllocMessageA( LONG version, LONG protocol, STRPTR interface_name, struct AddressAllocationMessage **result_ptr, struct TagItem *tags );
  129. LONG CreateAddrAllocMessage( LONG version, LONG protocol, STRPTR interface_name, struct AddressAllocationMessage **result_ptr, ... );
  130. VOID DeleteAddrAllocMessage( struct AddressAllocationMessage *aam );
  131. VOID BeginInterfaceConfig( struct AddressAllocationMessage *message );
  132. VOID AbortInterfaceConfig( struct AddressAllocationMessage *message );
  133. /* Monitor management */
  134. LONG AddNetMonitorHookTagList( LONG type, struct Hook *hook, struct TagItem *tags );
  135. LONG AddNetMonitorHookTags( LONG type, struct Hook *hook, ... );
  136. VOID RemoveNetMonitorHook( struct Hook *hook );
  137. /* Status query */
  138. LONG GetNetworkStatistics( LONG type, LONG version, APTR destination, LONG size );
  139. /* Domain name server management */
  140. LONG AddDomainNameServer( STRPTR address );
  141. LONG RemoveDomainNameServer( STRPTR address );
  142. VOID ReleaseDomainNameServerList( struct List *list );
  143. struct List *ObtainDomainNameServerList( VOID );
  144. /* Local database access */
  145. VOID setnetent( LONG stay_open );
  146. VOID endnetent( VOID );
  147. struct netent *getnetent( VOID );
  148. VOID setprotoent( LONG stay_open );
  149. VOID endprotoent( VOID );
  150. struct protoent *getprotoent( VOID );
  151. VOID setservent( LONG stay_open );
  152. VOID endservent( VOID );
  153. struct servent *getservent( VOID );
  154. /* Address conversion */
  155. LONG inet_aton( STRPTR cp, struct in_addr *addr );
  156. STRPTR inet_ntop( LONG af, APTR src, STRPTR dst, LONG size );
  157. LONG inet_pton( LONG af, STRPTR src, APTR dst );
  158. LONG In_LocalAddr( ULONG address );
  159. LONG In_CanForward( ULONG address );
  160. /* Kernel memory management */
  161. struct mbuf *mbuf_copym( struct mbuf *m, LONG off, LONG len );
  162. LONG mbuf_copyback( struct mbuf *m, LONG off, LONG len, APTR cp );
  163. LONG mbuf_copydata( struct mbuf *m, LONG off, LONG len, APTR cp );
  164. struct mbuf *mbuf_free( struct mbuf *m );
  165. VOID mbuf_freem( struct mbuf *m );
  166. struct mbuf *mbuf_get( VOID );
  167. struct mbuf *mbuf_gethdr( VOID );
  168. struct mbuf *mbuf_prepend( struct mbuf *m, LONG len );
  169. LONG mbuf_cat( struct mbuf *m, struct mbuf *n );
  170. LONG mbuf_adj( struct mbuf *mp, LONG req_len );
  171. struct mbuf *mbuf_pullup( struct mbuf *m, LONG len );
  172. /* Internet servers */
  173. BOOL ProcessIsServer( struct Process *pr );
  174. LONG ObtainServerSocket( VOID );
  175. /* Ten reserved slots for future expansion */
  176. /* Ten reserved slots for future expansion */
  177.  
  178. #ifdef __cplusplus
  179. }
  180. #endif /* __cplusplus */
  181.  
  182. #endif   /* CLIB_BSDSOCKET_PROTOS_H */
  183.